source(here::here("code/load.R"))

d <- read_csv(here("data/metapower_article_status - Sheet3.csv")) |> 
  select(-meta_id, -journal) |>
  rename(`Prop. political behavior` = behavior,
         `Prop. top journal` = top_journal,
         `Average publication year` = year,
         Subfield = subfield) |>
  mutate(included = ifelse(included == 1, "In sample", "Not in sample")) |>
  mutate(across(everything(), ~ ifelse(is.na(.x), 0, .x)))
  
modelsummary::datasummary_balance(
  ~included, data = d, 
  title = "Balance table",
  output = here("fig/balance_table.tex"))


